package cn.bingo.yunsj.common.exception;

/**
 * 错误消息枚举类
 */
public enum EmException implements CommonException {
    SYSTEM_EXCPTION(0,"系统异常"),
    FILE_EXCPTION(1,"文件异常"),
    PARAM_EXCPTION(2,"参数异常"),
    DK_EXCPTION(3,"重复主键"),
    STATE_FAIL(4,"不要重复启动！"),
    DISABLE_FAIL(5,"不要重复禁用！"),
    NEW_FAIL(6,"新入职贺卡最多启动三个,请先禁用一个或多个！"),
    OTHER_FAIL(7,"该贺卡最多启动一个,请先禁用一个！"),
    TYPE_FAIL(8,"文件只能上传word.docx！"),
    ADMIN_FAIL(9,"不是admin用户"),
    REP_FAIL(10,"只能补发三天内"),
    ;

    private int code;
    private String message;

    EmException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getErrCode() {
        return code;
    }

    @Override
    public String getErrMessage() {
        return message;
    }

    @Override
    public CommonException setErrMessage(String message) {
        this.message = message;
        return this;
    }
}
